package sk.tramtatiri.pages.users;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.PropertyModel;

public class BMIResultPanel extends Panel {

	private static final long serialVersionUID = -7485417511537188562L;
	
	private Label label;
	private String BMIResLabel = "Original Label Text";
	
	public BMIResultPanel(String id) {
		super(id);
		label=new Label("label", new PropertyModel(this, "BMIResLabel"));
		label.setOutputMarkupId(true);
		
		add(label);
	}

	public void setNewBMIResult(double bmiRes) {
		int pom = (int) (bmiRes * 100);
		double res = pom / 100.0;
		this.BMIResLabel = " " + Double.toString(res);
	}
}
